<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>Document</title>
</head>
<body>
	<input type="text" id="num1">
	<input type="text" id="num2">
	<br>
	<button id="jia">+</button>
	<button id="jian">-</button>
	<button id="cheng">*</button>
	<button id="chu">/</button>
	<script>
		function v (e){
			return document.getElementById(e);
		}
		v("jia").onclick=function(){
			var x=parseInt(v("num1").value);
			var y=parseInt(v("num2").value);
			alert(x+y);
		}
		v("jian").onclick=function(){
			var x=parseInt(v("num1").value);
			var y=parseInt(v("num2").value);
			alert(x-y);
		}
		v("cheng").onclick=function(){
			var x=parseInt(v("num1").value);
			var y=parseInt(v("num2").value);
			alert(x*y);
		}
		v("chu").onclick=function(){
			var x=parseInt(v("num1").value);
			var y=parseInt(v("num2").value);
			alert(x/y);
		}
	</script>
</body>
</html>